<?php
namespace Common\Model;
use Think\Model;

/**
 * 留言内容model操作
 * @author  singwa
 */
class MessageModel extends Model {
    private $_db = '';

    public function __construct() {
        $this->_db = M('Message');
    }
    public function select($data = array(), $limit = 100) {

        $conditions = $data;
        $list = $this->_db->where($conditions)->order('id desc')->limit($limit)->select();
        return $list;
    }

    public function getmessage($page,$pageSize=10) {
       

        $offset = ($page - 1) * $pageSize;
        return $this->_db->order('id desc')->limit($offset,$pageSize)->select();

    }



    public function delById($id) {
  
        return $this->_db->delete($id);
    }

}
